import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'


Vue.config.productionTip = false


import { Button,Field,NavBar, Uploader,Form} from 'vant';
import { Tabbar, TabbarItem } from 'vant';
import { Search } from 'vant';
import { Tab, Tabs } from 'vant';
import { Lazyload } from 'vant';
import { ActionSheet } from 'vant';
import { Picker } from 'vant';
import { ShareSheet } from 'vant';
import { Image as VanImage } from 'vant';
import { Cell, CellGroup } from 'vant';
import { Icon } from 'vant';
import { DropdownMenu, DropdownItem } from 'vant';
import {Popup} from'vant';
import { Toast } from 'vant';
import { DatetimePicker } from 'vant';

Vue.use(DatetimePicker);

Vue.use(Toast);
Vue.use(Form);

Vue.use(Popup);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);

Vue.use(Icon);

Vue.use(Cell);
Vue.use(CellGroup);

Vue.use(VanImage);

Vue.use(ShareSheet);

Vue.use(Picker);

Vue.use(ActionSheet);

Vue.use(Lazyload);

Vue.use(Tab);
Vue.use(Tabs);


Vue.use(Search);

Vue.use(Tabbar);
Vue.use(TabbarItem);


Vue.use(NavBar);
Vue.use( Uploader);

Vue.use(Button);
Vue.use(Field);


axios.defaults.baseURL = 'https://d33a5037-6c63-4e92-8bb1-30018ab701ea.bspapp.com/http'

Vue.prototype.$http = axios;

let token = localStorage.getItem('token');
// if(token){
//   this.$store.dispatch('getUserInfo',token)
// }

Vue.mixin({
  data(){
    return{
      baseColor:'#07c160'
    }
  },
  methods:{
    // checkLogin(url='/login',msg='请先登录',t=500){
    //   if(!this.$store.state.uid){
    //     Toast(msg)
    //     setTimeout(v=>{
    //       this.$router.push(url)
    //     },t)
    //     return false
    //   }
    //   return true
    // }
  }
})

Vue.prototype.$bus = new Vue()

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
